﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SpringStudio.Common;
using SpringStudio.DAL;
using Sdepci.InfoCode.BLL.CodeDesign;

namespace Sdepci.InfoCode.Web.CodeDesign
{
    public partial class ExistSerialSelector : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                this.BindData();
            }
        }

        private void BindData()
        {
            if (this.Request.QueryString["RuleGuid"] != null && this.Request.QueryString["RuleGuid"].Trim().Length > 0)
            {
                this.lblRuleName.Text = new TypeRule(this.Request.QueryString["RuleGuid"].Trim()).RuleName;
                this.ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script language=\"javascript\">document.getElementById(\"TreeXmlData\").value = '" + new InfoManager().GetExistXmlDoc(this.Request.QueryString["RuleGuid"].Trim()).OuterXml + "';</script>");
            }
        }
    }
}
